package jdbc;

import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.DriverManager;
import java.sql.SQLException;

public class TestDrivers {

	public static void main(String args[]) throws ClassNotFoundException,
			SQLException {
		// Type-1 driver JDBC-ODBC Bridge

		Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
		Connection con = DriverManager.getConnection(
				"jdbc:odbc:myoracle_datasource", "hr", "admin");
		System.out.println("connected to:");

		DatabaseMetaData dbdata = con.getMetaData();
		System.out.println(dbdata.getDatabaseProductName() 
				+    dbdata.getDatabaseProductVersion());
		con.close();
	}
}
